@extends('admin.layout.index')

@section('css')

<link rel="stylesheet" type="text/css" href="/admins/css/page_page.css">
@endsection
@section('content')
<div class="mws-panel grid_8">
                    	<div class="mws-panel-header">
                        	<span><i class="icon-table"></i>文章列表</span>
                        </div>
                            <div class="mws-panel-body no-padding">
                            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
                            <div id="DataTables_Table_0_length" class="dataTables_length">
                        <form action="/admin/artical/index" method="get">
                            <label>显示 <select size="1" name="count" aria-controls="DataTables_Table_0">
                            <option value="10" @if(!empty($request['count']) && $request['count'] == 10)selected @endif>10</option>
                            <option value="25" @if(!empty($request['count']) && $request['count'] == 25)selected @endif>25</option>
                            <option value="50" @if(!empty($request['count']) && $request['count'] == 50)selected @endif>50</option>
                            <option value="100" @if(!empty($request['count']) && $request['count'] == 100)selected @endif>100</option>
                            </select>条</label>
                            </div>
                            <div class="dataTables_filter" id="DataTables_Table_0_filter">
                            	<label>
                                    关键字: <input type="text" name="search" value="{{ $request['search'] or ''}}" aria-controls="DataTables_Table_1">
                                </label>
                            	<input type="submit" value="搜索">
                        </form>
                        </div>
                        <table class="mws-datatable mws-table dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
                            <thead>
                                <tr role="row">
	                                <th class="sorting_asc" >文章编号</th>
	                                <th class="sorting">文章标题</th>
	                                <th class="sorting" >文章内容</th>
	                                <th class="sorting" >添加时间</th>
	                                <th class="sorting" >点击数</th>
	                                <th class="sorting" >分类名称</th>
	                                <th class="sorting" >操作</th>
                                </tr>
                            </thead>
                            
                        <tbody role="alert" aria-live="polite" aria-relevant="all">
                        @foreach($data as $k=>$v)
                        		<tr class="odd">
                                    <td class="  sorting_1">{{ $v['id'] }}</td>
                                    <td class=" ">{{ $v['name'] }}</td>
                                    <td class=" ">{{ $v['content'] }}</td>
                                    <td class=" ">{{ $v['atime'] }}</td>
                                    <td class=" ">{{ $v['clicknum'] }}</td>
                                    <td class=" ">{{ $v['catname'] }}</td>
                                    <td class=" ">
	                                    	<a href="/admin/artical/delete/{{ $v['id'] }}" style="color:black;font-size:20px;margin-left:20px" title="删除"><i class="icon-trash"></i></a>
	                                    	<a href="/admin/artical/edit/{{ $v['id'] }}" style="color:black;font-size:20px;margin-left:20px" title="修改"><i class="icon-pencil-2"></i></a>
	                               </td>
                                </tr>
                        @endforeach
                                </tbody>
                                </table>
                                <div class="dataTables_info" id="DataTables_Table_0_info">Showing 1 to 10 of 57 entries</div>

                    			<div id="page_page" class="dataTables_paginate paging_full_numbers">
	                                <!-- 接收分配过来的值data -->
	                                {!! $data->appends($request)->render() !!}
	                                </div>
						</div>
                    </div>
                </div>
@endsection